<!DOCTYPE html>
<html>

	<head>
		<title>我的消息</title>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		    <link rel="stylesheet" href="/js/bootstrap-4.1.1-dist/css/bootstrap.min.css">
			<script src="/js/jquery/jquery.min.js"></script>
			<script src="/js/bootstrap-4.1.1-dist/js/bootstrap.min.js"></script>
			<link rel="stylesheet" href="/css/font/css/font-awesome.min.css"/>
			<link rel="stylesheet" href="/css/reset.css"/>
			<link rel="stylesheet" href="/css/message.css" />
			<script src="/js/plugins/jrender/jrender.min.js"></script>
			<link rel="stylesheet" href="/js/plugins/dialog2/dialog.css"/>
			<script src="/js/plugins/dialog2/dialog.min.js"></script>
			<script src="/js/common.js"></script>
		<script>
			$(function () {

			    //获取用户信息
			    var user = JSON.parse(sessionStorage.getItem("user"));

				//发送请求查询是否有系统消息<系统通知>
                $.get("/messages/systemMessage",{brower:0}, function (data) {
                    if(data.list.length>0){
                        //渲染数据
                      $("#systemMessage").html(data.list.length);

					}
				});

                //发送请求查询用户是否有私信未浏览<私信>
                var num=0;//定义未读信息数量
                $.get("/messages/"+user.id, function (data) {
                    console.log(data);
                    //渲染数据
                    $.each(data,function (index,ele) {
                        num+=ele.number;
                    });
                    if(num==0){
                        //渲染数据
                        $("#privateMessage").html("");
					}else{
                        //渲染数据
                        $("#privateMessage").html(num);
					}

            });

            /** 一进页面就发请求查询当前用户的点赞数<点赞> ckw**/
            $.get("/travelLike/getTravelLikerNum?userId="+user.id,function (data) {
                if(data>0){
                    var temp = '<span class="badge badge-danger badge-pill">'+data+'</span>'
                    $("#likeItem").append(temp);
                }
            })
        })
	</script>

</head>

<body>
<div class="search-head">
	<div class="row nav-search">
		<div class="col">
			<a href="/mine/profiles.html">
				<span><i class="fa fa-chevron-left" ></i></span>
			</a>
		</div>
		<div class="col">
			<span>我的消息</span>
		</div>
		<div class="col"></div>
	</div>
</div>

		<ul class="list-group">
			<!--点赞通知-->
			<a href="/mine/likeNotice.html">
				<li class="list-group-item d-flex justify-content-between align-items-center">
					<div class="item" id="likeItem">
						<span><i class="fa fa-thumbs-o-up" ></i></span>
						<span >赞</span>
                    </div>
					<i class="fa fa-chevron-right"></i>
				</li>
			</a>

	<a href="../index.html">
		<li class="list-group-item d-flex justify-content-between align-items-center">
			<div class="item">
				<span><i class="fa fa-commenting-o" ></i>	</span>
				<span>评论</span>
				<span class="badge badge-danger badge-pill">1</span>
			</div>
			<i class="fa fa-chevron-right"></i>
		</li>
	</a>
	<a href="/mine/letter.html">
		<li class="list-group-item d-flex justify-content-between align-items-center">
			<div class="item">
				<span><i class="fa fa-envelope-o" ></i></span>
				<span>私信</span>
				<span class="badge badge-danger badge-pill" id="privateMessage" ></span>
			</div>
			<i class="fa fa-chevron-right"></i>
		</li>
	</a>
	<a href="/mine/friend/index.html">
		<li class="list-group-item d-flex justify-content-between align-items-center">
			<div class="item">
				<span><i class="fa fa-weixin" aria-hidden="true"></i></span>
				<span>朋友圈</span>
				<span class="badge badge-danger badge-pill">1</span>
			</div>
			<i class="fa fa-chevron-right"></i>
		</li>
	</a>

	<a href="/mine/systemMessage.html" id="system" >
		<li class="list-group-item d-flex justify-content-between align-items-center">
			<div class="item">
				<span><i class="fa fa-bell" ></i></span>
				<span>系统通知</span>
				<span class="badge badge-danger badge-pill" id="systemMessage"></span>
			</div>
			<i class="fa fa-chevron-right"></i>
		</li>
	</a>
</ul>

<div class="container systemMsg">
	<dl class="itemList">
		<dd>
			<p>如果你无法简洁的表达你的想法，那只说明你还不够了解它。</p>
			<p>-- 阿尔伯特·爱因斯坦</p>
			<p>32分钟前</p>
		</dd>
		<dd>
			<p>如果你无法简洁的表达你的想法，那只说明你还不够了解它。</p>
			<p>-- 阿尔伯特·爱因斯坦</p>
			<p>32分钟前</p>
		</dd>
		<dd>
			<p>如果你无法简洁的表达你的想法，那只说明你还不够了解它。</p>
			<p>-- 阿尔伯特·爱因斯坦</p>
			<p>32分钟前</p>
		</dd>
	</dl>
</div>

	</body>

</html>